<style>
.width {
	min-width: 119px;
}
	.modalwidth {
	width: 550px;	
	height: 240px;
}
</style>



<section class="wrapper">


	<div class="col-lg-12">
		<!--work progress start-->
		<section class="panel">

			<div class="inbox-head">
				<h3>BANNER MANAGEMENT</h3>
				<a href="<?= base_url();?>banner/admin/banner/add"><button type="button" class="btn btn-danger pull-right">
					<i class="icon-plus"></i>
				</button></a>
			</div>
		
				

			<div class="panel-body">
				
				
				<div class="input-group pull-right">
                                          <form name="action" method="POST"
							action="<?=base_url(); ?>banner/admin/banner/banner_list">
							
							<input type="hidden"
					name="<?php echo $this->security->get_csrf_token_name(); ?>"
					value="<?php echo $this->security->get_csrf_hash();?>" />
							<div class="col-lg-offset-2 col-lg-7">
							</div>
							 <select class="form-control" name="filter" style="width:100px"
								onchange="this.form.submit()">
								<option value="">-Select-</option>
								<option value="inactive">Inactive</option>
								<option value="active">Active</option>
							
							</select>
						</form>
                                          
                                          
                                             
                                              </div>
				<?php if($banners['info']){?>
				<table class="table table-striped table-advance table-hover">
					<thead>
						<tr>
							<th><i class="icon-bullhorn"></i> View</th>
							<th><i class="icon-bookmark"></i> Impressions</th>
						<th><i class="icon-bookmark"></i> Priod</th>
						<th><i class="icon-bookmark"></i> Page</th>
						<th><i class="icon-bookmark"></i> Status</th>
						<th><i class=" icon-edit"></i> Action</th>
						</tr>
					</thead>
					<tbody>
						
						<?php foreach ($banners['info'] as $banners): ?>
							<tr>
						<th><a id="mediaVideo" href="#" data-toggle="modal"
							data-target="<?='#'.$banners->id; ?>"> <img height="50"
								width="80"
								src="<?= base_url() ?>assets/img/advertisement/<?= $banners->value;?>"
								alt="photo of " />
						</a>
						</th>
						<td><?= $banners->impressions;?></td>
						<td><?= $banners->start_date;?>-To-<?= $banners->end_date;?></td>
						<td><?php if ($banners->shows=="0") echo 'All';?> <?php if ($banners->shows=="2") echo 'Inner';?>
							<?php if ($banners->shows=="1") echo 'Index';?> <?php if($banners->status ==51){?>
							<?php if ($banners->shows=="3") echo 'Category';?> <?php if ($banners->shows=="4") echo 'Front Slider';?>
							<?php }?>
						</td>
						<td><?php if($banners->status ==51){?>
							<button class="btn btn-success btn-xs">
								<i class=" icon-ok"> Active</i>
							</button> <?php }else{?>
							<button class="btn btn-danger btn-xs">
								<i class=" icon-remove"> Inactive</i>
							</button> <?php }?></td>


						<td>

							<div class="dropdown">
								<a href="javascript:;"
									class="dropdown-toggle btn btn-danger btn-xs"
									data-toggle="dropdown">Menu <b class="caret"></b>
								</a>
								<ul class="dropdown-menu width">
									<li>
									<?php if($banners->status ==1){?>
									<a href="<?= base_url(); ?>banner/admin/banner/change_banner_status/<?= $banners->status;?>/<?= $banners->id; ?>"
									<?php if($this->config->item('mode')=='DEMO'){?>
										onclick="alert ('Sorry! Demo mode '); return false;"
									<?} else?> onclick="return confirm('Are you sure ?');"><button
												class="btn btn-primary btn-xs">
												<i class="icon-thumbs-up"></i>
											</button> Active</a>
											
											</li>
											
									<li>
									<?php }else{?>
									<a href="<?= base_url(); ?>banner/admin/banner/change_banner_status/<?= $banners->status;?>/<?= $banners->id; ?>"
									<?php if($this->config->item('mode')=='DEMO'){?>
										onclick="alert ('Sorry! Demo mode '); return false;"
									<?} else?> onclick="return confirm('Are you sure ?');"><button
												class="btn btn-danger btn-xs">
												<i class="icon-thumbs-down"></i>
											</button> Inactive</a>
											<?php }?>
											
											</li>
									<li><a href="<?= base_url(); ?>banner/admin/banner/edit/<?= $banners->id;?>"
									<?php if($this->config->item('mode')=='DEMO'){?>
										onclick="alert ('Sorry! Demo mode '); return false;"
									<?} else?> onclick="return confirm('Are you sure ?');"><button
												class="btn btn-primary btn-xs">
												<i class="icon-pencil"></i>
											</button> Edit</a></li>
									<li><a href="<?= base_url(); ?>banner/admin/banner/delete/<?= $banners->id;?>/<?= $banners->value;?>"
									<?php if($this->config->item('mode')=='DEMO'){?>
										onclick="alert ('Sorry! Demo mode '); return false;"
									<?} else?> onclick="return confirm('Are you sure ?');"><button
												class="btn btn-danger btn-xs">
												<i class="icon-trash"></i>
											</button> Delete</a></li></ul>
							
							</div>
						</td>
					</tr>


					<div class="modal fade" id="<?=$banners->id; ?>" tabindex="-1"
						role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">



						<div class="modal-dialog">
							<div class="modal-content">

								<div class="modal-header">

									<button type="button" class="close" data-dismiss="modal"
										aria-hidden="true">X</button>

								</div>


								<div class="modal-body">

									<img class="modalwidth"
										src="<?= base_url() ?>assets/img/advertisement/<?= $banners->value;?>"
										alt="">
								</div>

							</div>
							<!-- /.modal-content -->
						</div>
						<!-- /.modal-dialog -->

					</div>
					<!-- /.modal -->
						
						<?php endforeach;?>
						
					</tbody>
					
				</table>
				<?php }else{?>
				
  <p class="text text-warning">Opps! No Product found....</p>
				<?php }?>
			</div>

		</section>
		<!--work progress end-->
	</div>

</section>

